package designpattern.singleton;
//4、双检锁/双重校验锁
public class Singleton4 {
	private Singleton4(){
	}
	private static volatile Singleton4 instance;
	
	public static Singleton4 getInstance() {
		if(instance==null){
			synchronized (Singleton4.class) {
				if(instance==null){
					instance=new Singleton4();
				}
			}
		}
		return instance;
	}
}
